package com.authine.cloudpivot.ext.dto.model.invoice;

import com.authine.mvp.app.launcher.domain.AttachmentFormat;
import com.authine.mvp.app.launcher.domain.SelectorFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@Builder
@Schema(description = "发票申请单记录")
public class InvoiceApply {

    @Schema(description = "发票申请单编号")
    private String id;
    @Schema(description = "红冲发票对应的蓝票ID")
    private String offset_id;
    @Schema(description = "金税ID")
    private String golden_tax_id;
    @Schema(description = "发票类型")
    private String type;
    @Schema(description = "发票状态")
    private String statuss;
    @Schema(description = "发票业务类型")
    private String business_type;
    @Schema(description = "票面机器编号")
    private String machine_number;
    @Schema(description = "票面 发票代码")
    private String code;
    @Schema(description = "票面发票号码")
    private String number;
    @Schema(description = "票面开票日期")
    private Date date;
    @Schema(description = "票面校验码")
    private String check_code;
    @Schema(description = "票面购买方名称")
    private String purchase_name;
    @Schema(description = "票面购买方纳税人识别号")
    private String purchase_number;
    @Schema(description = "票面购买方地址")
    private String purchase_address;
    @Schema(description = "票面购买方电话")
    private String purchase_phone;
    @Schema(description = "票面购买方开户行")
    private String purchase_bank;
    @Schema(description = "票面购买方账号")
    private String purchase_account;
    @Schema(description = "票面销售方名称")
    private String sale_name;
    @Schema(description = "票面销售方纳税人识别号")
    private String sale_number;
    @Schema(description = "票面销售方地址")
    private String sale_address;
    @Schema(description = "票面销售方电话")
    private String sale_phone;
    @Schema(description = "票面销售方开户行")
    private String sale_bank;
    @Schema(description = "票面销售方账号")
    private String sale_account;
    @Schema(description = "票面价格小计")
    private BigDecimal price_amount;
    @Schema(description = "票面税额小计")
    private BigDecimal tax_amount;
    @Schema(description = "票面价税合计")
    private BigDecimal total;
    @Schema(description = "蓝票被红冲的金额")
    private BigDecimal offset_total;
    @Schema(description = "票面备注")
    private String memo;
    @Schema(description = "票面收款人")
    private String recipient_contact;
    @Schema(description = "票面复核")
    private String checks;
    @Schema(description = "票面开票人")
    private String drawer;
    @Schema(description = "申请日期")
    private Date apply_time;
    @Schema(description = "确认收票日期")
    private Date confirm_time;
    @Schema(description = "申请人的ID")
    private String apply_member_id;
    @Schema(description = "申请人全名")
    private String apply_member_name;
    @Schema(description = "购买方组织ID")
    private SelectorFormat purchase_organization_id;
    @Schema(description = "购买方组织全名")
    private String purchase_organization_name;
    @Schema(description = "销售方组织ID")
    private SelectorFormat sale_organization_id;
    @Schema(description = "销售方组织全名")
    private String sale_organization_name;
    @Schema(description = "确认开票的人ID")
    private String drawer_member_id;
    @Schema(description = "发票申请单确认开票的人全名")
    private String drawer_member_name;
    @Schema(description = "确认收票人ID")
    private String recipient_member_id;
    @Schema(description = "发票申请单确认收票人全名")
    private String recipient_member_name;
    @Schema(description = "物流收件人")
    private String receiver;
    @Schema(description = "物流收件地址")
    private String address;
    @Schema(description = "物流收件电话")
    private String phone;
    @Schema(description = "物流信息[快递名，快递号]")
    private String logistic_info;
    @Schema(description = "是否已维护物流信息")
    private Integer has_logistic_info;
    @Schema(description = "已核销商品交易金额（含税）")
    private BigDecimal can_trade_total;
    @Schema(description = "可核销金额")
    private BigDecimal write_off_amount;
    @Schema(description = "是否删除")
    private Boolean deleted;
    @Schema(description = "")
    private Integer version;
    @Schema(description = "拓展字段")
    private String extends_attr;
    @Schema(description = "订单类型")
    private String order_type;
    @Schema(description = "已核销金额")
    private BigDecimal written_off_amount;
    @Schema(description = "附件个数")
    private Integer number_attachments;
    @Schema(description = "附件列表")
    private List<AttachmentFormat> attachments_json;
    @Schema(description = "业务类型")
    private String trade_order_type;
    @Schema(description = "审批意见")
    private String approvalReason;
    @Schema(description = "开票税率")
    private String tax_rate;
    @Schema(description = "发票单创建时间")
    private Date createdTime;
    @Schema(description = "发票单所属平台ID")
    private String platform_organization_id;
    private List<InvoiceRecord> invoiceApplyRecordList;

    @Schema(description = "发票申请单开票明细")
    private List<InvoiceDetail> invoiceDetailList;

    @Schema(description = "是否小规模纳税人标识")
    private String smallscale;
    private boolean ifSubmit;
    @Schema(description = "账套名称")
    private String account_name;
}
